<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello</title>
    <script src="jquery.js" type="text/javascript"></script>
    <script>
        $(function (){
            $("#submit").on('click', function () {
                $.ajax({
                    url: '/insert',
                    data: {'id': 72, 'name': $("#username").val(), 'age': 22,'pwd':$("#passwd").val()},
                    type: 'POST',
                    success: function (data) {
                        window.open("/show","_self");
                    }
                });

            });
        })
    </script>
</head>
<body>

  <div>用户名: <input id="username" type="text"><br></div>

  <div>密码:<input id="passwd" type="password"><br></div>

  <button id="submit">submit</button>
</body>
</html>